<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>dom初体验</title>
</head>
<body>
    <!-- 元素 -->
    <div id="app">
        <p id='p'>hello</p>
        <h1>world</h1>
        <h2></h2>
        <div></div>
    </div>
</body>
<script>
    // js代码，脚本
    var d = document.getElementById('app');
    var p = document.getElementById('p')
    console.log(d.nodeType)
    console.log(d.nodeName)
    console.log(d.nodeValue)
    console.log(d.childNodes)
    console.log(d.parentNode)
    console.log(p.previousSibling)
    console.log('----------------')
    console.log(p.nextSibling)
    console.log(d.firstChild)
    console.log(d.lastChild)
    console.log(d.ownerDocument)
    // console.log(d.innerHTML);

    // d.innerHTML = 'terry'

    // d.onclick = function() {
    //     d.hidden = true;
    // }

    //学习api的重点

    //1.功能

    //2.需要的参数

    //3.返回
</script>
</html>

